Skip to main content

player

Type

object

Summary

A control that displays a movie or sound file.

Syntax

player

Description

Use the player object type to display a movie or sound from a separate file.

Unlike an audio clip or video clip, a player does not contain the movie or sound data. Instead, you use the player's filename property to indicate the separate file that holds the movie or sound. This reduces the memory required by your stack, because the movie or sound data is only loaded into memory when it's being used, rather than being loaded into memory whenever the stack file is open. However, it also makes it possible for the movie or sound data to be misplaced during distribution, since the file is separate from your stack file.

A player is contained in a card, group, or background. Players cannot contain other objects.

Important

Setting a player's filename does not automatically update its currentTime property. If you play a movie file, then change the player's filename in order to play another, you must reset the currentTime to zero in order to start from the beginning of the second movie :

    set the filename of player \"My Player\" to \"SecondMovie.mov\"
set the currentTime of player \"My Player\" to zero

Examples

start player "San Antone"
hide player (the selectedText of button "Current Movie")

object: stack, player

property: filename, currentTime

function: movie

glossary: property, stack file, movie, loaded into memory, object type

keyword: templatePlayer, control, file

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

Platforms

desktop

server

Associated Syntax

Message

NameSummarySyntax
socketErrorSent when an error occurs on a socket that causes the socket to close or to fail to open.socketError <pSocketID>, <pErrorString>
mouseWithinSent periodically to an object while the mouse pointer is within its borders.mouseWithin
hotspotClickedRemoved in LiveCode 10.0. hotspotClicked <pHotspotID>
dragEndSent to the object a drag and drop started from, when the data is dropped.dragEnd
playPausedSent to a player when the user pauses it.playPaused
nameChangedSent to an object when its name is changed.nameChanged <pOldName>, <pNewName>
dragDropSent to the object where data was dropped when a drag and drop finishes.dragDrop
playStartedSent to a player when it starts playing.playStarted
deletePlayerSent to a player just before it is removed from the stack.deletePlayer
nodeChangedRemoved in LiveCode 10.0.nodeChanged <pNewNodeID>
dragLeaveSent when the mouse pointer moves out of an object during a drag and drop.dragLeave
socketTimeoutSent when an open socket, read from socket or write to socket command halts for the time specified by the socketTimeoutInterval property. socketTimeout <pSocketID>
selectedObjectChangedSent to an object when it is selected.selectedObjectChanged
dragEnterSent when the mouse pointer moves into an object during a drag and drop.dragEnter
mouseReleaseSent when the user releases the mouse outside the control that was clicked. mouseRelease <pButtonNumber>
mouseDownSent when the user presses the mouse button.mouseDown <pButtonNumber>
playStoppedSent to a player when it stops playing.playStopped
selectionChangedSent to a field or player when the selection is changed.selectionChanged
mouseEnterSent when the mouse pointer moves into an object.mouseEnter
mouseUpSent when the user releases the mouse button.mouseUp <pButtonNumber>
dragMoveSent when the user moves the mouse during a drag and drop.dragMove
mouseStillDownSent periodically while the mouse button is being held down.mouseStillDown <pButtonNumber>
dragStartSent to a control when the user clicked on it and then started to drag the mouse pointer.dragStart
qtDebugStrRemoved in LiveCode 10.0.qtDebugStr <pString>
newPlayerSent to a new player right after it's created.newPlayer
mouseMoveSent when the user moves the mouse.mouseMove <pNewMouseH>, <pNewMouseV>
currentTimeChangedSent to a player when the user switches to another frame.currentTimeChanged <pNewTime>
resizeControlSent to a control right after the user resizes it.resizeControl
mouseLeaveSent when the mouse pointer moves out of an object.mouseLeave
socketClosedSent when the remote system closes a socket.socketClosed <pSocketID>
mouseDoubleUpSent when the mouse button is released at the end of a double-click.mouseDoubleUp <pButtonNumber>
mouseDoubleDownSent when the user double-clicks.mouseDoubleDown <pButtonNumber>

Command

NameSummarySyntax
stopStops a currently playing sound or movie.stop [playing] {<player> | <videoClip> | <audioClip>}
startResumes playing a paused movie or sound.start <player>

Property

NameSummarySyntax
statusSpecifies the current status of a player objectput the status of player "myPlayer" into tStatus
topRightSpecifies the location of the specified object's upper right corner. set the topRight of <object> to <right>, <top>
formattedWidthReports the width needed by an object to display its full contents without scrolling.get the formattedWidth of <object> get the formattedWidth of [<chunk> of] <field>
scriptSpecifies the contents of an object's **script**.set the script of <object> to <string>
borderColorSpecifies the color of an object's border.set the borderColor of <object> to {empty | <colorName> | <RGBColor>} set the borderColor of <line> of <field> to {empty | <colorName> | <RGBColor>}
hilitePixelSpecifies which entry in the color table is used for the background color when an object, or text in an object, is highlighted. set the hilitePixel of <object> to <colorNumber>
patternsSpecifies all the patterns of an object, in shorthand form.set the patterns of <object> to <patternsList>
loopingSpecifies whether a movie or sound stops at the end, or restarts from the beginning.set the looping of <player> to {true | false}
numberSpecifies an object's position within a file, a card's position within a stack, or a control's layer on a card.set the number of <card> to <number> get the number of <object>
topLeftSpecifies the location of the specified object's upper left corner. set the topLeft of <object> to left,top
altIDSpecifies an alternate ID for objects.set the altID of <object> to <IDNumber>
rightSpecifies how far an object's right edge is from the left edge of the window or screen.set the right of <object> to <pixels>
focusPatternSpecifies the pattern used for an object's outline when it has the insertion point or is active focused.set the focusPattern of <object> to {<patternNumber> | <imageID> | empty}
zoomRemoved in LiveCode 10.0.set the zoom of <player> to <degrees>
topPatternSpecifies the pattern used to draw a three-D object's raised edge. set the topPattern of <object> to {<patternNumber> | <imageID> | empty}
constraintsRemoved in LiveCode 10.0.get the constraints of <player>
foregroundColorSpecifies the color of object text and borders.set the foregroundColor of <object> to {empty | <colorName> | <RGBColor>} set the foregroundColor of [<chunk> of] <field> to {empty| <colorName> | <RGBColor>}
mirroredSpecifies whether a player displays the video frames in "mirrored" mode. set the mirrored of <player> to {true | false}
borderPixelSpecifies which entry in the color table is used for the color of an object's border.set the borderPixel of <object> to <colorNumber>
shadowPixelSpecifies which entry in the color table is used for the color of an object's drop shadow or the background of a scrollbar.set the shadowPixel of <object> to <colorNumber>
behaviorAllows an object to inherit its script handlers from another object.set the behavior of <object> to {<button> | <stack>}
customPropertiesSpecifies all the custom properties of an object that are in the current customPropertySet, along with their settings.set the customProperties of <object> to <propertiesArray> set the customProperties[<propertySet>] of <object> to <propertiesArray>
shadowColorSpecifies the color of an object's drop shadow or the background of a scrollbar.set the shadowColor of <object> to {empty | <colorName> | <RGBColor>}
trackCountSpecifies the number of separate tracks in a movie.get the trackCount of <player>
filenameSpecifies the file associated with a player or image.set the filename of {<image> | <player>} to {<filePath> | <URL>}
callbacksSpecifies messages to be sent during playback of a movie.set the callbacks of <player> to <messageList>
currentNodeRemoved in LiveCode 10.0.set the currentNode of <player> to <nodeID>
movieControllerIDRemoved in LiveCode 10.0.get the movieControllerID of <player>
textSizeSpecifies the point size of text displayed by an object.set the textSize of <object> to <pointSize> set the textSize of [<chunk> of] <field> to <pointSize>
showControllerSpecifies whether a player's controller bar is visible.set the showController of <player> to {true | false}
shadowOffsetSpecifies the size and direction of an object's drop shadow.set the shadowOffset of <object> to <pixels>
textFontSpecifies the font face of text in an object.set the textFont of <object> to <fontName> [, <language>] set the textFont of [<chunk> of] <field> to <fontName> [, <language>]
currentTimeSpecifies the elapsed time in a movie or sound.set the currentTime of <player> to <number>
enabledSpecifies that an object is active and responds to user action. set the enabled of <object> to {true | false}
enabledTracksSpecifies which tracks in a movie are available to be played. set the enabledTracks of <player> to <tracksList>
backgroundColorSpecifies an object's background color.set the backgroundColor of <object> to {empty | <colorName> | <RGBColor>} set the backgroundColor [of <chunk>] [of <line>] of <field> to {empty| <colorName> | <RGBColor>}
hiliteColorSpecifies the color of the background when an object, or text in an object, is highlighted.set the hiliteColor [of <object>] to {empty | <colorName> | <RGBColor>}
mediaTypesSpecifies one or more types of media used in a movie.get the mediaTypes of <player>
dropShadowSpecifies the drop shadow to use for an object.set the dropShadow of object to <propertiesArray> set the dropShadow[<propertyName>] of object to <propertyValue>
bottomPatternSpecifies the pattern of a three-D object's lowered edge.set the bottomPattern of <object> to {empty | <patternNumber> | <imageID>}
customPropertySetsLists all the custom property sets that can apply to an object. get the customPropertySets of <object>
hilitePatternSpecifies the fill pattern used for the background when an object, or text in an object, is highlighted. set the hilitePattern of <object> to {<patternNumber> | <imageID> | empty}
showBadgeSpecifies whether a player's badge icon is visible.set the showBadge of <player> to {true | false}
visibleSpecifies whether an object can be seen or is hidden.set the [effective] visible of <object> to {true | false}
shadowPatternSpecifies the pattern of an object's drop shadow.set the shadowPattern of <object> to {<patternNumber> | <imageID> | empty}
layerSpecifies the back-to-front order of objects on a card or the order of cards in a stack.set the layer of <object> to {<layerNumber> | top | bottom}
backgroundPatternThe **backgroundPattern** specifies the pattern used to draw an object's background.set the backgroundPattern of <object> to {<patternNumber> | <imageID> | empty}
topColorSpecifies the color of a three-D object's raised edge.set the topColor of <object> to {empty | <colorName> | <RGBColor>}
showSelectionSpecifies whether the user can select a portion of the movie or sound in a player.set the showSelection of <player> to {true | false}
playRateSpecifies how fast a player plays a movie.set the playRate of <player> to <rate>
bottomSpecifies how far an object's bottom edge is from the top of the window or screen.set the bottom of <object> to <number>
borderPatternSpecifies the pattern of an object's border.set the borderPattern of <object> to {empty | <patternNumber> | <imageID>}
colorOverlaySpecifies the color overlay to use for an object.set the colorOverlay of object to <propertiesArray> set the colorOverlay[<propertyName>] of object to <propertyValue>
heightSpecifies the distance from an object's top edge to its bottom edge. set the height of <object> to <numberOfPixels>
endTimeSpecifies the end of the selected portion of a sound or movie.set the endTime of <player> to <endPoint>
outerGlowSpecifies the outer glow to use for an object.set the outerglow of object to <propertiesArray> set the outerglow[<propertyName>] of object to <propertyValue>
dontUseQTRemoved in LiveCode 10.0.set the dontUseQT [of player <player>] to {true | false}
bottomPixelSpecifies which entry in the color table is used for the color of a three-D object's lowered edge.set the bottomPixel of <object> to <colorNumber>
loadedTimeSpecifies the time of a sound/movie, up to which the sound/movie can be played. get the loadedTime of player "myPlayer"
hotspotsRemoved in LiveCode 10.0.get the hotspots of <player>
durationSpecifies the length of a sound or movie.get the duration of <player>
leftBalanceSpecifies the volume of the left stereo channel output of a player control.set the leftBalance of <player> to <percentage>
tracksLists all the tracks in a movie.get the tracks of <player>
topSpecifies how far an object's top edge is from the top of the window or screen.set the top of <object> to <numberOfPixels>
rectangleSpecifies the area within which an object is drawn.set the rectangle of <object> to <left>, <top>, <right>, <bottom> get the [effective] rectangle of <object>
invisibleSpecifies whether an object is hidden.set the invisible of <object> to {true | false} get the [effective] invisible of <object>
layerModeSpecifies whether an object is dynamic or static.set the layerMode of <object> to <mode> get the [effective] layerMode of <object>
topPixelSpecifies which entry in the color table is used for the color of a three-D object's raised edge.set the topPixel of <object> to <colorNumber>
timeScaleReports the number of intervals per second of a movie or sound.get the timeScale of <player>
tiltRemoved in LiveCode 10.0.set the tilt of <player> to <degrees>
bottomRightSpecifies the location of the specified object's lower right corner. set the bottomRight of <object> to right,bottom
foregroundPixelSpecifies which entry in the color table is used for an object's text and borders.set the foregroundPixel of <object> to <colorNumber>
unicodeTooltipSpecifies the explanatory text (UTF-16 string) that pops up in a small box when the user points to an object.set the unicodeTooltip of object to <unicodeString>
bottomLeftSpecifies the location of the specified object's lower left corner. set the bottomLeft of <object> to <left>, <bottom>
innerShadowSpecifies the inner shadow to use for an object.set the innerShadow of object to <propertiesArray> set the innerShadow[<propertyName>] of object to <propertyValue>
audioPanSpecifies the proportion of audio panned from one stereo channel to the other.set the audioPan of <player> to <positive/negative percentage>
startTimeSpecifies the beginning of the selected portion of a sound or movie.set the startTime of <player> to <startPoint>
locationSpecifies where an object is.set the location of <object> to <point>
leftSpecifies how far an object's left edge is from the left edge of the window or screen.set the left of <object> to <numberOfPixels>
showFocusBorderDisplays a border around the active control.set the showFocusBorder of <control> to {true | false}
panRemoved in LiveCode 10.0.set the pan of <player> to <degrees>
nodesRemoved in LiveCode 10.0.get the nodes of <player>
playSelectionSpecifies whether a player plays back its entire movie or sound, or only the selected portion.set the playSelection of <player> to {true | false}
disabledSpecifies that an object is dimmed and does not respond to user action.set the disabled of <object> to {true | false}
selectedSpecifies whether an object is **selected**.set the selected of <object> to {true | false}
propertiesSpecifies some of an object's **properties** and their current values. set the properties of <object> to <propertiesArray>
colorsSpecifies all the colors of an object, in shorthand form.set the colors of <object> to <colorsList>
IDReports the unique ID number assigned to an object.set the ID of {image | stack} to <number> get the [{ long | abbreviated | short }] ID of <object>
customPropertySetSpecifies a set of custom properties applied to an object.set the customPropertySet of object to {setName | empty}
backgroundPixelSpecifies which entry in the color table is used for an object's background color.set the backgroundPixel of <object> to <colorNumber>
rightBalanceSpecifies the volume of the right stereo channel output of a player control.set the rightBalance of <player> to <percentage>
focusPixelSpecifies which entry in the color table is used for the color of an object's outline when it has the insertion point or is active focused.set the focusPixel of <object> to <colorNumber>
bottomColorSpecifies the color of a three-D object's lowered edge.set the bottomColor of <object> to {empty | <colorName> | <RGBColor>}
textStyleSpecifies the style or styles applied to text in an object.set the textStyle of <object> to {empty | plain | <stylesList>} set the textStyle of [<chunk> of] <field> to {empty | plain | <stylesList>} set the textStyle[<style>] of object to {true | false}
threeDSpecifies whether an object appears to stick out of or recede into the screen.set the threeD of <object> to {true | false}
widthThe **width** of an object is the distance from its left edge to its right edge.set the width of <object> to <numberOfPixels>
showBorderSpecifies whether an outline is drawn around an object.set the showBorder of <object> to {true | false}
innerGlowSpecifies the inner glow to use for an objectset the innerGlow of object to <propertiesArray> set the innerGlow[<propertyName>] of object to <propertyValue>
nameSpecifies the name of an object.set the [{ long | abbreviated | short }] name of <object> to <string> get the name
ownerReports which object is next in the object hierarchy.get the [{ long | abbreviated | short }] owner of <object>
formattedHeightReports the height needed by an object to display its full contents without scrolling.get the formattedHeight of <object> get the formattedHeight of [<chunk> of] <field>
focusColorSpecifies the color of the outline around the active control or the field with the insertion point.set the focusColor of <object> to {empty | <colorName> | <RGBColor>}
pausedSpecifies whether a sound or movie is paused.set the paused of <player> to {true | false}
customKeysLists the names of all the custom properties of an object. set the customKeys of <object> to {<propertiesList> | empty}
foregroundPatternSpecifies the pattern used for object text and borders.set the foregroundPattern of <object> to {<patternNumber> | <imageID> | empty} set the foregroundPattern of [<chunk> of] <field> to {<patternNumber> | <imageID> | empty}
Thank you for your feedback!

Was this page helpful?